/*
 * @Author: ૮₍ ˙О˙₎ა
 * @Date: 2023-05-31 13:48:51
 */

import { request } from "@/utils/http";
import { ReqHosListDepartList, ReqHospitalFindScheduleList, ReqHospitalFindScheduleListParm, ReqHospitalListComplete, ReqHospitalListDetail, ReqHospitalListParameters, ReqHospitalScheduleCom, ReqHospitalScheduleParm, ReqProvinceOrCityOrDistrictOrHospitalS } from "./model/hospitalListTypes";

/**
 * @description: 获取医院列表api
 * @return {*} Promise<ReqHospitalListComplete>
 * @param {ReqHospitalListParameters} {page,limit,...args}
 */
export function GetHospitalListResponse({page,limit,...args}:ReqHospitalListParameters){
    return request.get<any,ReqHospitalListComplete>(`/admin/hosp/hospital/${page}/${limit}`,{
        params:args
    })
}


/**
 * @description: 获取省份的api
 * @return {*} Promise<ReqProvinceOrCityOrDistrictOrHospitalS>
 * @param {} 
 */
export function GetProvinceResponse(){
    return request.get<any,ReqProvinceOrCityOrDistrictOrHospitalS>(`/admin/cmn/dict/findByDictCode/province`)
}


/**
 * @description: 获取市 区 医院的api
 * @return {*} Promise<ReqProvinceOrCityOrDistrictOrHospitalS>
 * @param {} 
 */
export function GetCityOrDistrictOrHospitalSResponse(parentId:string){
    return request.get<any,ReqProvinceOrCityOrDistrictOrHospitalS>(`/admin/cmn/dict/findByParentId/${parentId}`)
}

/**
 * @description: 修改医院状态的api
 * @return {*} Promise<ReqProvinceOrCityOrDistrictOrHospitalS>
 * @param {} id:string,status:number
 */
export function GetHospitalListStatusResponse(id:string,status:number){
    return request.get<any,null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}

/**
 * @description: 获取医院详情的api
 * @return {*} Promise<ReqProvinceOrCityOrDistrictOrHospitalS>
 * @param {} id:string,status:number
 */
export function GetHospitalListDetailResponse(id:string){
    return request.get<any,ReqHospitalListDetail>(`/admin/hosp/hospital/show/${id}`)
}

/**
 * @description: 获取医院列表科室的api
 * @return {*} Promise<ReqHosListDepartList>
 * @param {} id:string,status:number
 */
export function GetHospitalListDepartResponse(hoscode:string){
    return request.get<any,ReqHosListDepartList>(`/admin/hosp/department/${hoscode}`)
}


/**
 * @description: 获取医院列表排班日期api
 * @return {*} Promise<ReqHospitalScheduleCom>
 * @param {}{page,limit,hoscode,depcode}:ReqHospitalScheduleParm
 */
export function GetHospitalListScheduleResponse({page,limit,hoscode,depcode}:ReqHospitalScheduleParm){
    return request.get<any,ReqHospitalScheduleCom>(`/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}


/**
 * @description: 获取医院列表排班日期的医生api
 * @return {*} Promise<ReqHospitalFindScheduleList>
 * @param {} {hoscode,depcode,workDate}:ReqHospitalFindScheduleListParm
 */
export function GetHospitalListFindScheduleListResponse({hoscode,depcode,workDate}:ReqHospitalFindScheduleListParm){
    return request.get<any,ReqHospitalFindScheduleList>(`/admin/hosp/schedule/findScheduleList/${hoscode}/${depcode}/${workDate}`)
}